﻿using AutoMapper;
using DearlerPlatform.Core.DataBaseCommon;
using DearlerPlatform.Domain.Entity;
using DearlerPlatform.Service.CustomerApp.Dto;
using DearlerPlatform.Service.CustomerApp.Views;
using DearlerPlatform.Service.ProductApp.Views;

namespace DearlerPlatform.WebApi.Profiles
{
    public class MapperProfile : Profile
    {
        public MapperProfile()
        {
            CreateMap<Customers, CustomerLoginVM>().ReverseMap();
            CreateMap<Products, ProductsVM>().ReverseMap();
            CreateMap<Productphotos, ProductsVM>().ForMember(dest => dest.Id,opt => opt.Ignore()).ReverseMap();
            CreateMap<Productsaleareadiffs, ProductsVM>().ForMember(dest => dest.Id, opt => opt.Ignore()).ReverseMap();
            CreateMap<Productsales, ProductsVM>().ForMember(dest => dest.Id, opt => opt.Ignore()).ReverseMap();
            CreateMap(typeof(CorePageData<>), typeof(PageViewBase<>)).ReverseMap();
            CreateMap<Productphotos, ProductphotosVM>().ReverseMap();
            CreateMap<Productsales, ProductsalesVM>().ReverseMap();
        }
    }
}
